import yaml
import random
import os

def get_random_oneword():
    """从配置文件中随机返回一条语录"""
    config_path = r'e:\Code\dgut-video\dgut-video-backend\oneword-config.yaml'
    
    with open(config_path, 'r', encoding='utf-8') as file:
        data = yaml.safe_load(file)
    
    if data and 'words' in data:
        return random.choice(data['words'])
    return "啊喔，看来笨蛋管理员又忘记配置每日一句了"

if __name__ == "__main__":
    print(get_random_oneword())